<template>
	<view class="gui-padding">
		<view v-if="recordList.length <= 0" class="gui-margin-top gui-text-center gui-color-gray">
			暂无数据
		</view>
		<view v-for="(d,i) in recordList" class="list" v-else>
			<view class="list_img">
				<img :src="$uimg+ d.imageId" alt="" style="width: 100%;height: 200rpx;border-radius: 20rpx;">
			</view>
			<view class="list_content">
				<view class="list_title">
					{{d.courseName}}
				</view>
				<view class="list_desc">
					{{d.progress}}%
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				recordList: [],
				page_index: 1,
				user: uni.getStorageSync("member")
			}
		},
		onLoad() {
			this.get_data();
		},
		methods: {
			get_data() {
				let self = this;
				let url = "API-COURSE/front/courseInfo/getMyCourseLearnRecord";
				this.$lg.Get(url, {
					page: self.page_index,
					pageSize: 20,
					isCom: 1,
					boya_id: self.user.lg_id
				}, function(res) {
					console.log('学习记录res: ', res);
					self.recordList = res.data.rows;
				}, err => {
					console.log('学习记录err: ', err);
				}, false, false)
			},
		}
	}
</script>

<style>
	page {
		width: 100vw;
		height: 100vh;
		background: url("https://boyaltd.oss-cn-hangzhou.aliyuncs.com/bj_liand.png") 100% 100% / 100% 100%;
		/* background-repeat:no-repeat; */
	}

	.list {
		display: flex;
		justify-content: space-between;
		border-radius: 20rpx;
		margin-top: 20rpx;
		background-color: white;
	}

	.list_img {
		padding: 8rpx;
		width: 50%;
		height: 200rpx;
		border-radius: 30rpx;
	}

	.list_content {
		padding: 20rpx;
		flex: 1;
		display: flex;
		justify-content: space-between;
		flex-direction: column;
	}

	.list_title {
		font-size: 26rpx;
		font-weight: bold;

	}

	.list_desc {
		font-size: 24rpx;
		color: #999999;

	}
</style>